#include<iostream>
#include<iomanip>
using namespace std;

int n;

void swapline(double* a, double* b) {
	double* tem = a;
	a = b;
	b = tem;
}
void num_multiply(double* a, double b) {
	for (int i = 0; i < 2 * n; i++) {
		*(a + i) *= b;
	}
}
void plus_line(double* a, double* b, double c) {
	for (int i = 0; i < 2 * n; i++) {
		*(a + i) += (*(b + i)) * c;
	}
}
int main1() {

	cin >> n;
	double** p = new double* [n];
	for (int j = 0; j < n; j++) {
		p[j] = new double[2 * n];
	}
	for (int i = 0; i < n; i++) {
		for (int j = 0; j < n; j++) {
			cin >> p[i][j];
		}
	}
	for (int i = 0; i < n; i++) {
		for (int j = n; j < 2 * n; j++) {
			p[i][j] = 0;
		}
	}
	for (int i = 0; i < n; i++) {
		p[i][i + n] = 1;
	}

	for (int i = 0; i < n; i++) {

		int k = 0;
		while (p[i][i] == 0) {
			swapline(p[i], p[k]);
			k++;
		}

		num_multiply(p[i], 1.0 / p[i][i]);
		for (int x = 0; x < n; x++) {
			if (x == i)continue;
			else {
				plus_line(p[x], p[i], -p[x][i]);
			}
		}
	}

	cout << fixed << setprecision(4);
	for (int i = 0; i < n; i++) {
		for (int j = n; j < 2 * n; j++) {

			cout << p[i][j] << " ";

		}
		cout << endl;
	}
	return 0;
}
